#include <bits/stdc++.h>
using namespace std;

// [a,b]
class Solution {
public:
	int search(vector<int>& nums, int target) {
		int left = 0;
		int right = nums.size() - 1;
		while(left <= right){
//			int mid = (left + right) / 2;
			int mid = left + ((right - left) / 2);
			if(target < nums[mid]){
				right = mid - 1;
			}else if(target > nums[mid]){
				left = mid + 1;
			}else{
				return mid;
			}
		}
		return -1;
	}
	int search2(vector<int>& nums, int left,int right,int target) {
		int mid = (left + right) / 2;
		if(nums[mid] > target){
			search2(nums,left,mid-1,target);
		}else if(nums[mid] < target){
			search2(nums,mid+1,right,target);
		}else{
			return mid;
		}
	}
};


int main(){
	
	
	
}
